| C1.Xaml.FlexGrid アセンブリ > C1.Xaml.FlexGrid 名前空間 > RowColCollection<T> クラス : DeferNotifications メソッド |
'宣言 Public Function DeferNotifications() As System.IDisposable
public System.IDisposable DeferNotifications()
以下のサンプルは、グリッドで複数の列の幅を設定する間、DeferNotifications メソッドを使用して通知を一時停止する方法を示します。
DeferNotifications メソッドの呼び出しが using 文に置かれていることに注意してください。これにより、ブロック内のコードが例外を生成した場合でも、オブジェクトが自動的に破棄され、ブロックの終りで通知が再開されます。これは、try/finally ブロック内で BeginUpdate メソッドと EndUpdate メソッドを呼び出す従来の方法より、コードが読みやすく簡潔です。
var grid = new C1FlexGrid(); using (grid.Columns.DeferNotifications()) { foreach (var col in grid.Columns) { col.Width = 100; } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2